package com.shuyuansystem.entity;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;

@Configuration
public class MultipartConfig {

    @Bean
    public CommonsMultipartResolver multipartResolver() {
        CommonsMultipartResolver resolver = new CommonsMultipartResolver();
        // 设置单个文件的最大上传大小，这里设置为 10MB
        resolver.setMaxUploadSize(10 * 1024 * 1024);
        // 设置单次请求的最大上传大小，这里设置为 10MB
        resolver.setMaxUploadSizePerFile(10 * 1024 * 1024);
        return resolver;
    }
}